package cn.xing.managementSystem.bean.pageable;

import cn.xing.managementSystem.bean.BaseBean;
import cn.xing.managementSystem.utils.PageableResponseListJsonDeserializer;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author cuixing
 * @package io.merculet.management.common.bean.pageable
 * @class PageableResponse
 * @email xing.cui@magicwindow.cn
 * @date 2018/4/3 下午4:07
 * @description
 */
@Data
public class PageableResponse<T extends Serializable> extends BaseBean {

    @JSONField(name = "total_count")
    @JsonProperty("total_count")
    private long totalCount;

    @JSONField(name = "total_pages")
    @JsonProperty("total_pages")
    private int totalPages;

    @JSONField(name = "cur_page")
    @JsonProperty("cur_page")
    private int curPage;

    @JSONField(name = "list")
    @JsonProperty("list")
    @JsonDeserialize(using = PageableResponseListJsonDeserializer.class)
    private List<T> list;
}
